﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin1/SiteAdmin.master" AutoEventWireup="true" CodeFile="PlaceName.aspx.cs" Inherits="admin1_PlaceName" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">

        $(function () {
            $("#add_category").click(function () {
                $("#add_cate").slideDown();
                $(".null").val('');
            });
            $(".icon1").click(function () {
                $("#add_cate").slideUp();
            });
            $(".icon1").click(function () {
                $("#edit_cate").slideUp();
            });
        });


    </script>
    <style>
        .control-group {
            border-top: 1px solid #ffffff;
            border-bottom: 1px solid #eeeeee;
            margin-bottom: 0;
        }

        .control-label {
            padding-top: 15px;
            width: 180px;
            float: left;
            text-align: right;
        }

        .controls {
            margin-left: 200px;
            padding: 10px 0;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <%-- Chinh sua--%>
    <asp:Panel ID="panel_Edit" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_ClosEdit" runat="server" OnClick="lbt_ClosEdit_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Chỉnh sửa thông tin</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Mã</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_CatId_Edit" CssClass="NameEdit" runat="server" Enabled="False"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Tên tiếng anh</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Name_Edit" CssClass="NameEdit" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Chưa nhập Name" ControlToValidate="txt_Name_Edit" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Tên tiếng việt</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_NameVN_Edit" CssClass="NameVnEdit" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Chưa nhập Name" ControlToValidate="txt_NameVN_Edit" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Địa Điểm</label>
                        <div class="controls">
                            <asp:DropDownList ID="ddl_Edit" CssClass="NameVnEdit" runat="server" Width="220px"></asp:DropDownList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Trạng thái</label>
                        <div class="controls">

                            <asp:RadioButtonList ID="radEdit" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="True">Hiện</asp:ListItem>
                                <asp:ListItem Value="False">Ẩn</asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btnSaveEdit" runat="server" Text="Save Change" class="btn btn-success" OnClick="btnSaveEdit_Click" ValidationGroup="a" />

                        </div>
                    </div>

                </div>
            </div>
        </div>
    </asp:Panel>
    <%-- Thêm mới --%>
    <asp:Panel ID="panel_Add" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_ClosAdd" runat="server" OnClick="lbt_ClosAdd_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Thêm mới </h5>
                </div>
                <div class="widget-content nopadding">

                    <div class="control-group">
                        <label class="control-label">Tên tiếng anh</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Name" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Chưa nhập Name" ControlToValidate="txt_Name" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Tên tiếng việt</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_NameVN" runat="server" CssClass="null" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Chưa nhập Name VN" ControlToValidate="txt_NameVN" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Địa Điểm</label>
                        <div class="controls">
                            <asp:DropDownList ID="ddl_Add" CssClass="NameVnEdit" runat="server" Width="220px"></asp:DropDownList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Trạng thái</label>
                        <div class="controls">
                            <asp:RadioButtonList ID="radAdd" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Selected="True" Value="True">Hiện</asp:ListItem>
                                <asp:ListItem Value="False">Ẩn</asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btnInsert" runat="server" Text="Save" class="btn btn-success" OnClick="btnInsert_Click" ValidationGroup="a" />

                        </div>
                    </div>

                </div>
            </div>
        </div>
    </asp:Panel>

    <%#Eval("LocId") %>
    <%-- Hien thi thong tin --%>
    <div class="row-fluid" style="margin-top: 10px;">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <asp:LinkButton ID="lbt_Add_New" runat="server" OnClick="lbt_Add_New_Click"><img src="img/icons/16/add.png"  width="34" /></asp:LinkButton>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                            <tr>
                                <th>Mã</th>
                                <th>Tên tiếng anh</th>
                                <th>Tên tiếng việt</th>
                                <th>Mã địa điểm</th>
                                <th>Trạng thái</th>
                                <th>Chức Năng</th>
                            </tr>
                        </thead>

                        <tbody>
                            <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="pu_load">
                                <ContentTemplate>
                                    <asp:Repeater ID="rpt_PlaceName" runat="server">
                                        <ItemTemplate>
                                            <tr class="gradeX">
                                                <td class="center"><%#Eval("PlaceNameId") %></td>
                                                <td><%#Eval("Name") %></td>
                                                <td><%#Eval("NameVN") %></td>
                                                <td><%#Eval("LocationId") %></td>
                                                <td><%#bool.Parse(Eval("Activated").ToString())?"Hiện":"Ẩn" %></td>
                                                <td class="center">
                                                    <asp:LinkButton ID="LinkButton1" CommandArgument='<%#Eval("PlaceNameId") %>' runat="server" OnClick="btnSua_Click" ToolTip="Chỉnh Sửa"><img src="img/icons/16/create.png" width="16" height="18"/></asp:LinkButton>
                                                    &nbsp;&nbsp;<asp:LinkButton ID="btnxoa" CommandArgument='<%#Eval("PlaceNameId") %>' runat="server" OnClick="btnxoa_Click" ToolTip="Xóa" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?')"><img src="img/icons/16/delete.png" width="16" height="18"/></asp:LinkButton>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </tbody>

                    </table>
                </div>
            </div>
        </div>
    </div>

</asp:Content>



